package com.bw.controller;

import com.alibaba.fastjson.JSONObject;
import com.bw.pojo.vo.ReturnVo;
import com.bw.service.impl.ReturnServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/return/*")
public class ReturnController extends BaseController{
    ReturnServiceImpl service = new ReturnServiceImpl();
    protected void returnPurchase(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String reqInfos = req.getParameter("reqInfos");
        ReturnVo returnVo = JSONObject.parseObject(reqInfos, ReturnVo.class);
        service.returnPurchase(returnVo);
        resp.getWriter().println(JSONObject.toJSONString(200));
    }
}
